package com.topisv.tms.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import com.topisv.tms.entity.WaCountPlan;
import com.topisv.tms.repository.WaCountPlanDao;
import com.topisv.tms.service.base.BaseService;

//Spring Bean的标识.
@Component
// 默认将类中的所有public函数纳入事务管理.
@Transactional(readOnly = true)
public class WaCountPlanService extends BaseService {
	@Autowired
	private WaCountPlanDao wcpDao;
	@Transactional(propagation=Propagation.REQUIRES_NEW)
	public List<WaCountPlan> findExecuteRecord() {
		return wcpDao.findExecuteRecord();
	}
	@Transactional(readOnly=false,propagation=Propagation.REQUIRES_NEW)
	public void save(WaCountPlan wcp){
		wcpDao.save(wcp);
	}
	@Transactional(readOnly=false,propagation=Propagation.REQUIRES_NEW)
	public void save(List<WaCountPlan> backCountWcpList) {
		wcpDao.save(backCountWcpList);
	}
}
